package com.cdtye.shuoh.controller.product;

import com.cdtye.common.webcore.web.AjaxJson;
import com.cdtye.shuoh.domain.product.vo.ProductPropertiesVo;
import com.cdtye.shuoh.service.product.ProductPropertiesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 产品属性Controller
 * @author ZhongWang Wang
 * @date 2022-12-21
 */

@RestController
@RequestMapping("/productProperties")
public class ProductPropertiesController {
    @Autowired
    private ProductPropertiesService productPropertiesService;

    /**
     * 分页查询
     * @param vo
     * @return
     */
    @PostMapping("/pageList")
    public AjaxJson pageList(@RequestBody ProductPropertiesVo vo){
        return AjaxJson.success(productPropertiesService.pageList(vo));
    }

    /**
     * 列表获取
     * @param vo
     * @return
     */
    @PostMapping("/list")
    public AjaxJson list(@RequestBody ProductPropertiesVo vo){
        return AjaxJson.success(productPropertiesService.list(vo));
    }

    /**
     * 根据产品标识获取产品属性
     * @param productIdentification
     * @return
     */
    @GetMapping("/getListByProductIdentification")
    public AjaxJson getListByProductIdentification(String productIdentification){
        return AjaxJson.success(productPropertiesService.getListByProductIdentification(productIdentification));
    }
}
